<template>
  <CategorySelector :disabled="!setIsShowAttrList" />

  <AttrList
    v-if="setIsShowAttrList"
    @setIsShowAttrList="setIsShowAttrList = $event"
    @setAttr="attr =$event"
  />
  <SaveOrUpdateAttr v-else @setIsShowAttrList="setIsShowAttrList = $event"  :attr="attr"/>
</template>

<script lang="ts">
export default {
  name: "XAttr",
};
</script>

<script lang="ts" setup>
import CategorySelector from "@/components/CategotySelector/index.vue";
import AttrList from "./components/AttrList.vue";
import SaveOrUpdateAttr from "./components/SaveOrUpdateAttr.vue";
import type { SaveAttrItem } from "@/api/product/modles/attrsModel";
import { ref } from "vue";
const setIsShowAttrList = ref(true);
const attr = ref<SaveAttrItem>({
  attrName: "",
  attrValueList: [],
});
</script>

<style scoped></style>